import cn.edu.dgut.Javabean_object.Person;
import cn.edu.dgut.Javabean_object.Person2;

import javax.persistence.EntityManager;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

@WebServlet("/bindServlet")
public class bindServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {


    }

    protected void doGet(HttpServletRequest request, HttpServletResponse resp) throws ServletException, IOException {

        HttpServletResponse response = (HttpServletResponse) resp;

        Map<String,String> infoMap = (Map<String, String>) request.getSession().getAttribute("Login");
        String user_number = infoMap.get("user_number");

        Map<String, String> message = new HashMap<String, String>();
        message.put("user_number", user_number);
        HttpSession session = request.getSession(true);
        session.setAttribute("Loginer", message);

        response.sendRedirect("https://cas.dgut.edu.cn?appid=javaee&state=STATE");




    }
}
